Imports Lucene.Net.Documents

Namespace Aricie.DNN.Modules.LuceneSearch.Business
    Public Class DefaultFieldGlossary
        Implements ILuceneFieldGlossary


        Public Function GetFieldDefinitions() As IList(Of FieldDefinition) _
            Implements ILuceneFieldGlossary.GetFieldDefinitions
            Dim toReturn As New List(Of FieldDefinition)

            ''''''''''''''
            'Lucene Fields
            ''''''''''''''

            'id fields
            toReturn.Add(New FieldDefinition(LuceneGeneralField.ProviderName, Field.Store.YES, Field.Index.NOT_ANALYZED, Field.TermVector.NO, False) With {.Displayed = False})
            toReturn.Add(New FieldDefinition(LuceneGeneralField.UpgradeProviderName, Field.Store.YES, Field.Index.NOT_ANALYZED, Field.TermVector.NO, False) With {.Displayed = False})
            toReturn.Add(New FieldDefinition(LuceneGeneralField.Uid, Field.Store.YES, Field.Index.NOT_ANALYZED, Field.TermVector.NO, False) With {.Displayed = False})
            toReturn.Add(New FieldDefinition(LuceneGeneralField.HashCode, Field.Store.YES, Field.Index.NOT_ANALYZED, Field.TermVector.NO, False) With {.Displayed = False})
            toReturn.Add(New FieldDefinition(LuceneGeneralField.ItemId, Field.Store.YES, Field.Index.NOT_ANALYZED, Field.TermVector.NO, False) With {.Displayed = False})
            toReturn.Add(New FieldDefinition(LuceneGeneralField.ParentUid, Field.Store.YES, Field.Index.NOT_ANALYZED, Field.TermVector.NO, False) With {.Displayed = False})
            toReturn.Add(New FieldDefinition(LuceneGeneralField.ParentItemId, Field.Store.YES, Field.Index.NOT_ANALYZED, Field.TermVector.NO, False) With {.Displayed = False})

            

            'author fields
            toReturn.Add(New FieldDefinition(LuceneGeneralField.AuthorName, Field.Store.YES, Field.Index.ANALYZED, Field.TermVector.NO, False))

            'content fields
            toReturn.Add(New FieldDefinition(LuceneGeneralField.KeyWords, Field.Store.YES, Field.Index.ANALYZED, Field.TermVector.NO, True, 3))
            toReturn.Add(New FieldDefinition(LuceneGeneralField.Category, Field.Store.YES, Field.Index.NOT_ANALYZED, Field.TermVector.NO, True, 3))
            toReturn.Add(New FieldDefinition(LuceneGeneralField.CategoryId, Field.Store.YES, Field.Index.NOT_ANALYZED, Field.TermVector.NO, False) With {.Displayed = False})
            toReturn.Add(New FieldDefinition(LuceneGeneralField.SubCategories, Field.Store.YES, Field.Index.NOT_ANALYZED, Field.TermVector.NO, True, 2))
            toReturn.Add(New FieldDefinition(LuceneGeneralField.SubCategoryIds, Field.Store.YES, Field.Index.NOT_ANALYZED, Field.TermVector.NO, False) With {.Displayed = False})
            toReturn.Add(New FieldDefinition(LuceneGeneralField.Text, Field.Store.YES, Field.Index.ANALYZED, Field.TermVector.WITH_POSITIONS_OFFSETS, True))
            toReturn.Add(New FieldDefinition(LuceneGeneralField.TextNoStore, Field.Store.NO, Field.Index.ANALYZED, Field.TermVector.WITH_POSITIONS_OFFSETS, True) With {.Displayed = False})
            toReturn.Add(New FieldDefinition(LuceneGeneralField.Tags, Field.Store.YES, Field.Index.ANALYZED, Field.TermVector.NO, True, 2))
            toReturn.Add(New FieldDefinition(LuceneGeneralField.TagIds, Field.Store.YES, Field.Index.NOT_ANALYZED, Field.TermVector.NO, False) With {.Displayed = False})
            toReturn.Add(New FieldDefinition(LuceneGeneralField.Remarks, Field.Store.YES, Field.Index.ANALYZED, Field.TermVector.WITH_POSITIONS_OFFSETS, True))
            toReturn.Add(New FieldDefinition(LuceneGeneralField.Comments, Field.Store.YES, Field.Index.ANALYZED, Field.TermVector.WITH_POSITIONS_OFFSETS, True, 0.5))
            toReturn.Add(New FieldDefinition(LuceneGeneralField.ImagePath, Field.Store.YES, Field.Index.NOT_ANALYZED, Field.TermVector.WITH_POSITIONS_OFFSETS, True, 0.5))


            'MetaData

            toReturn.Add(New FieldDefinition(LuceneGeneralField.ItemType, Field.Store.YES, Field.Index.NOT_ANALYZED, Field.TermVector.NO, True) With {.LocalizeValuedInstance = True})
            toReturn.Add(New FieldDefinition(LuceneGeneralField.ItemGroup, Field.Store.YES, Field.Index.NOT_ANALYZED, Field.TermVector.NO, True) With {.LocalizeValuedInstance = True})
            toReturn.Add(New FieldDefinition(LuceneGeneralField.Language, Field.Store.YES, Field.Index.NOT_ANALYZED, Field.TermVector.NO, False, 1))
            toReturn.Add(New FieldDefinition(LuceneGeneralField.Version, Field.Store.YES, Field.Index.NOT_ANALYZED, Field.TermVector.NO, False))
            toReturn.Add(New FieldDefinition(LuceneGeneralField.State, Field.Store.YES, Field.Index.NO, Field.TermVector.NO, False))
            toReturn.Add(New FieldDefinition(LuceneGeneralField.LastVersionId, Field.Store.YES, Field.Index.NO, Field.TermVector.NO, False) With {.Displayed = False})
            toReturn.Add(New FieldDefinition(LuceneGeneralField.IsDeleted, Field.Store.YES, Field.Index.NOT_ANALYZED, Field.TermVector.NO, False))
            toReturn.Add(New FieldDefinition(LuceneGeneralField.IsApproved, Field.Store.YES, Field.Index.NOT_ANALYZED, Field.TermVector.NO, False))
            toReturn.Add(New FieldDefinition(LuceneGeneralField.MetaTitle, Field.Store.YES, Field.Index.ANALYZED, Field.TermVector.NO, True))
            toReturn.Add(New FieldDefinition(LuceneGeneralField.MetaDescription, Field.Store.YES, Field.Index.ANALYZED, Field.TermVector.WITH_POSITIONS_OFFSETS, True))
            toReturn.Add(New FieldDefinition(LuceneGeneralField.MetaKeywords, Field.Store.YES, Field.Index.ANALYZED, Field.TermVector.WITH_POSITIONS_OFFSETS, True))
            toReturn.Add(New FieldDefinition(LuceneGeneralField.MetaLogo, Field.Store.YES, Field.Index.NO, Field.TermVector.NO, False))
            toReturn.Add(New FieldDefinition(LuceneGeneralField.SiteMapFrequency, Field.Store.YES, Field.Index.NOT_ANALYZED, Field.TermVector.NO, False))
            toReturn.Add(New FieldDefinition(LuceneGeneralField.SiteMapPriority, Field.Store.YES, Field.Index.NOT_ANALYZED, Field.TermVector.NO, False))

            toReturn.Add(New FieldDefinition(LuceneGeneralField.CanBeReturnedBySearch, Field.Store.YES, Field.Index.NOT_ANALYZED, Field.TermVector.NO, False) With {.Displayed = False})
            toReturn.Add(New FieldDefinition(LuceneGeneralField.ReturnedBySearchWindowStart, Field.Store.YES, Field.Index.NOT_ANALYZED, Field.TermVector.NO, False) With {.Displayed = False})
            toReturn.Add(New FieldDefinition(LuceneGeneralField.ReturnedBySearchWindowEnd, Field.Store.YES, Field.Index.NOT_ANALYZED, Field.TermVector.NO, False) With {.Displayed = False})

            'date fields

            toReturn.Add(New FieldDefinition(LuceneGeneralField.ModifiedDate, Field.Store.YES, Field.Index.NOT_ANALYZED, Field.TermVector.NO, False))
            toReturn.Add(New FieldDefinition(LuceneGeneralField.IndexedDate, Field.Store.YES, Field.Index.NOT_ANALYZED, Field.TermVector.NO, False))
            toReturn.Add(New FieldDefinition(LuceneGeneralField.PubHistory, Field.Store.NO, Field.Index.ANALYZED, Field.TermVector.NO, False))


            'Files

            toReturn.Add(New FieldDefinition(LuceneGeneralField.FileName, Field.Store.YES, Field.Index.ANALYZED, Field.TermVector.NO, False, 2))
            toReturn.Add(New FieldDefinition(LuceneGeneralField.ForcedUrl, Field.Store.YES, Field.Index.NO, Field.TermVector.NO, False) With {.Displayed = False})
            toReturn.Add(New FieldDefinition(LuceneGeneralField.FileSize, Field.Store.YES, Field.Index.NO, Field.TermVector.NO, False) With {.Displayed = False})
            toReturn.Add(New FieldDefinition(LuceneGeneralField.Path, Field.Store.YES, Field.Index.NO, Field.TermVector.NO, False))
            toReturn.Add(New FieldDefinition(LuceneGeneralField.Extension, Field.Store.YES, Field.Index.NO, Field.TermVector.NO, False))
            toReturn.Add(New FieldDefinition(LuceneGeneralField.IconPath, Field.Store.YES, Field.Index.NO, Field.TermVector.NO, False))
            



            ''''''''''''''''''
            'dotnetnuke fields
            ''''''''''''''''''

            'Id Fields

            toReturn.Add(New FieldDefinition(DnnSearchItemField.PortalId, Field.Store.YES, Field.Index.NOT_ANALYZED, Field.TermVector.NO, False) With {.Displayed = False})
            toReturn.Add(New FieldDefinition(DnnSearchItemField.TabId, Field.Store.YES, Field.Index.NOT_ANALYZED, Field.TermVector.NO, False) With {.Displayed = False})
            toReturn.Add(New FieldDefinition(DnnSearchItemField.ModuleId, Field.Store.YES, Field.Index.NOT_ANALYZED, Field.TermVector.NO, False) With {.Displayed = False})
            toReturn.Add(New FieldDefinition(DnnSearchItemField.ModuleName, Field.Store.YES, Field.Index.NOT_ANALYZED, Field.TermVector.NO, False) With {.Displayed = False})
            toReturn.Add(New FieldDefinition(DnnSearchItemField.FriendlyModuleName, Field.Store.YES, Field.Index.ANALYZED, Field.TermVector.NO, False))

            'author fields
            toReturn.Add(New FieldDefinition(DnnSearchItemField.Author, Field.Store.YES, Field.Index.NOT_ANALYZED, Field.TermVector.NO, False) With {.Displayed = False})


            'content fields
            toReturn.Add(New FieldDefinition(DnnSearchItemField.Title, Field.Store.YES, Field.Index.ANALYZED, Field.TermVector.WITH_POSITIONS_OFFSETS, True, 5))
            toReturn.Add(New FieldDefinition(DnnSearchItemField.Description, Field.Store.YES, Field.Index.ANALYZED, Field.TermVector.WITH_POSITIONS_OFFSETS, True, 3))
            toReturn.Add(New FieldDefinition(DnnSearchItemField.Content, Field.Store.YES, Field.Index.ANALYZED, Field.TermVector.WITH_POSITIONS_OFFSETS, True))
            toReturn.Add(New FieldDefinition(DnnSearchItemField.SearchKey, Field.Store.YES, Field.Index.NOT_ANALYZED, Field.TermVector.NO, False) With {.Displayed = False})

            'date fields
            toReturn.Add(New FieldDefinition(DnnSearchItemField.PubDate, Field.Store.YES, Field.Index.NOT_ANALYZED, Field.TermVector.NO, False))

            'dnn additional fields
            toReturn.Add(New FieldDefinition(DnnSearchItemField.Guid, Field.Store.YES, Field.Index.NOT_ANALYZED, Field.TermVector.NO, False) With {.Displayed = False})
            toReturn.Add(New FieldDefinition(DnnSearchItemField.ImageFileId, Field.Store.YES, Field.Index.NOT_ANALYZED, Field.TermVector.NO, False) With {.Displayed = False})
            toReturn.Add(New FieldDefinition(DnnSearchItemField.ModuleTitle, Field.Store.NO, Field.Index.ANALYZED, Field.TermVector.WITH_POSITIONS_OFFSETS, True, 0.5))
            toReturn.Add(New FieldDefinition(DnnSearchItemField.TabName, Field.Store.NO, Field.Index.ANALYZED, Field.TermVector.WITH_POSITIONS_OFFSETS, True, 0.25))
            toReturn.Add(New FieldDefinition(DnnSearchItemField.TabTitle, Field.Store.NO, Field.Index.ANALYZED, Field.TermVector.WITH_POSITIONS_OFFSETS, True, 0.25))
            toReturn.Add(New FieldDefinition(DnnSearchItemField.TabDescription, Field.Store.NO, Field.Index.ANALYZED, Field.TermVector.WITH_POSITIONS_OFFSETS, True, 0.2))
            toReturn.Add(New FieldDefinition(DnnSearchItemField.ParentTabId, Field.Store.NO, Field.Index.NOT_ANALYZED, Field.TermVector.NO, False) With {.Displayed = False})
            toReturn.Add(New FieldDefinition(DnnSearchItemField.ParentTabName, Field.Store.NO, Field.Index.ANALYZED, Field.TermVector.WITH_POSITIONS_OFFSETS, True, 0.1))
            toReturn.Add(New FieldDefinition(DnnSearchItemField.ParentTabTitle, Field.Store.NO, Field.Index.ANALYZED, Field.TermVector.WITH_POSITIONS_OFFSETS, True, 0.1))
            toReturn.Add(New FieldDefinition(DnnSearchItemField.ParentTabDescription, Field.Store.NO, Field.Index.ANALYZED, Field.TermVector.WITH_POSITIONS_OFFSETS, True, 0.05))


            'Permissions
            toReturn.Add(New FieldDefinition(DnnSearchItemField.TabViewRoleIds, Field.Store.YES, Field.Index.NOT_ANALYZED, Field.TermVector.NO, False) With {.Displayed = False})
            toReturn.Add(New FieldDefinition(DnnSearchItemField.ModuleViewRoleIds, Field.Store.YES, Field.Index.NOT_ANALYZED, Field.TermVector.NO, False) With {.Displayed = False})
            toReturn.Add(New FieldDefinition(DnnSearchItemField.ItemViewRoleIds, Field.Store.YES, Field.Index.NOT_ANALYZED, Field.TermVector.NO, False) With {.Displayed = False})
            toReturn.Add(New FieldDefinition(DnnSearchItemField.TabViewUserIds, Field.Store.YES, Field.Index.NOT_ANALYZED, Field.TermVector.NO, False) With {.Displayed = False})
            toReturn.Add(New FieldDefinition(DnnSearchItemField.ModuleViewUserIds, Field.Store.YES, Field.Index.NOT_ANALYZED, Field.TermVector.NO, False) With {.Displayed = False})
            toReturn.Add(New FieldDefinition(DnnSearchItemField.ItemViewUserIds, Field.Store.YES, Field.Index.NOT_ANALYZED, Field.TermVector.NO, False) With {.Displayed = False})
            toReturn.Add(New FieldDefinition(DnnSearchItemField.InheritTabViewPermissions, Field.Store.YES, Field.Index.NOT_ANALYZED, Field.TermVector.NO, False) With {.Displayed = False})
            toReturn.Add(New FieldDefinition(DnnSearchItemField.InheritModuleViewPermissions, Field.Store.YES, Field.Index.NOT_ANALYZED, Field.TermVector.NO, False) With {.Displayed = False})

            ' taxonomy
            toReturn.Add(New FieldDefinition(DnnSearchItemField.CompoundedTaxonomy, Field.Store.YES, Field.Index.NOT_ANALYZED, Field.TermVector.NO, True, 2))
            toReturn.Add(New FieldDefinition(DnnSearchItemField.TabTaxonomy, Field.Store.YES, Field.Index.NOT_ANALYZED, Field.TermVector.NO, True, 2))
            toReturn.Add(New FieldDefinition(DnnSearchItemField.ModuleTaxonomy, Field.Store.YES, Field.Index.NOT_ANALYZED, Field.TermVector.NO, True, 2))
            toReturn.Add(New FieldDefinition(DnnSearchItemField.ContentTaxonomy, Field.Store.YES, Field.Index.NOT_ANALYZED, Field.TermVector.NO, True, 2))


            Return toReturn
        End Function
    End Class
End Namespace


